import { Component, OnInit } from '@angular/core';
import { FormBuilder, Validators } from '@angular/forms';
import { AuthService } from '../../shared/services/auth.service';
import { Router } from '@angular/router';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.less']
})
export class LoginComponent implements OnInit {
  loginForm = this.fb.group({
    account: ['', Validators.required],
    password: ['', Validators.required],
    remember: [true]
  });
  constructor(private fb: FormBuilder, private authService: AuthService) {}
  ngOnInit(): void {}
  onSubmit() {
    this.authService.login(this.loginForm.value);
  }
}
